{extend name="index/iframe" /}

{block name="content"}
<div class="admin-header-lock" id="lock-box">
    <div class="admin-header-lock-img">
        <img src="__STATIC__/img/xqmy.jpg"></div>
    <div class="admin-header-lock-name my-color" id="lockUserName">{$Think.session.admin.remark}</div>
    <div class="input_btn">
        <input type="password" class="admin-header-lock-input layui-input my-btn" autocomplete="off" placeholder="请输入密码解锁.." name="lockPwd" id="lockPwd">
        <button class="layui-btn my-btn" id="unlock">解锁</button>
    </div>
    <p>请输入"{$Think.session.admin.lock}"，否则不会解锁成功哦！！！</p>
</div>
{/block}

{block name="css"}
<style>
    .admin-header-lock{width: 320px; height: 170px; padding: 20px; position: relative; text-align: center;}
    .admin-header-lock-img{width: 70px; height: 70px; margin: 0 auto;}
    .admin-header-lock-img img{width: 70px; height: 70px; border-radius: 0;}
    .admin-header-lock-name{margin: 8px 0 15px 0;}
    .input_btn{ overflow: hidden; margin-bottom: 10px; }
    .admin-header-lock-input{width: 170px; color: #fff;float: left; margin:0 10px 0 40px; border:none;}
    .admin-header-lock-input::-webkit-input-placeholder {color:#fff;}
    .admin-header-lock-input::-moz-placeholder {color:#fff;}
    .admin-header-lock-input::-ms-input-placeholder {color:#fff;}
    .admin-header-lock-input:-moz-placeholder {color:#fff;}
    #unlock{ float: left; }
    #lock-box p{ color:#e60000; }
</style>
{/block}

{block name="js"}
<script>
    layui.use(['element','jquery','layer'], function(){
        var element = layui.element
            ,$ = layui.jquery
            ,layer = layui.layer
            ,index = parent.layer.getFrameIndex(window.name);


        $('#unlock').click(function(){
            var val = $('#lockPwd').val();
            if(val != "{$Think.session.admin.lock}"){
                layer.msg('密码错误');
            }else{
                layui.data('lock', {key: 'on',remove: true});
                $('#lockScreen', window.parent.document).parent().removeClass('layui-this');
                parent.layer.close(index);
            }
        })

        $('#lockPwd').focus();

        $(document).keyup(function(event){
            if(event.keyCode == 13){
                $('#unlock').trigger("click");
            }
        });
    });
</script>
{/block}